module.exports = (err, ctx) => {
  // console.log(err)
  let status = 500
  switch (err.code) {
    case '10001':
      status = 403
      break
    case '10002':
      status = 409
      break
    case '10006':
      status = 422
      break
    default:
      status = 500
  }

  ctx.status = status

  ctx.body = err

  console.log(err)
}
